<template>
  <MainSlot v-loading="loading">
    <template v-slot:btn>
      <BtnSlot :btnList="btnList" @handleEvent="getBtnEvent"></BtnSlot>
    </template>
    <template v-slot:table>
      <DraggableItem ref="draggableItem"></DraggableItem>
    </template>
  </MainSlot>
</template>
<script>
import MainSlot from "@/components/MainSlot";
import BtnSlot from '@/components/BtnSlot';
import DraggableItem from './components/draggableItem.vue';

export default {
  components: { MainSlot, BtnSlot, DraggableItem },
  data() {
    return {
      loading: false,
      btnList: ['add'],
    }
  },
  mounted() { },
  methods: {

    //获取选中Btn
    getBtnEvent(flag) {
      console.log(flag)
      if (flag == 'add') {
        this.dialogVisible = true;
        this.$refs.draggableItem.addCode();
      }
      this.addEditFlag = flag
    },
  }
};
</script>
<style lang="scss" scoped></style>
  